package com.sample.client.data

/**接口响应*/
data class ResponseData<T>(
    val success: Boolean = false,
    val what: Int = 2,
    val data: T? = null,
    var message: String? = null,
    val code: String? = null,
    val tag: Any? = null
) {
    companion object {
        @JvmStatic
        fun <T> success(what: Int = 2, data: T?, tag: Any? = null): ResponseData<T> {
            return ResponseData(success = true, what = what, data = data, tag = tag)
        }

        @JvmStatic
        fun <T> fail(
            what: Int = 2,
            message: String?,
            tag: Any? = null
        ): ResponseData<T> {
            return ResponseData(what = what, message = message, tag = tag)
        }
    }
}


